function setupWebViewJavascriptBridge(callback) {
  if (window.loadAndroid.aaa) {
  	alert(1111)
    return callback(window.WebViewJavascriptBridge);
  }else{
  	alert(2222)
  }
}

// 对外推送方法
export default {
  callhandler(name, data, callback) {
    setupWebViewJavascriptBridge((bridge) => {
      bridge.callHandler(name, data, callback);
    });
  },
  registerhandler(name, callback) {
    setupWebViewJavascriptBridge((bridge) => {
      bridge.registerHandler(name, (data, responseCallback) => {
        callback(data, responseCallback);
      });
    });
  },
};